<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.qml</title>
<meta name="generator" content="KF5::SyntaxHighlighting (QML)"/>
</head><body style="color:#1f1c1b"><pre>
<span style="font-weight:bold;">import</span><span style="color:#bf0303;"> Qt 4.6</span>

<span style="color:#898887;">// some random qml snippets stolen from the qt docs</span>

<span style="color:#008000;">Rectangle</span> {
    <span style="color:#0057ae;">important</span>: <span style="font-weight:bold;">true</span>
    <span style="color:#0057ae;">propertyAsdf</span>:
    <span style="color:#0057ae;">id</span>: container
    <span style="color:#0057ae;">signalA</span>: bla
    <span style="font-weight:bold;">property</span> <span style="color:#0057ae;">string</span> label
    <span style="color:#0095ff;font-weight:bold;">signal</span> clicked
    <span style="color:#0057ae;">radius</span>: <span style="color:#b08000;">5</span>; <span style="color:#0057ae;">border</span>.<span style="color:#0057ae;">color</span>: <span style="color:#bf0303;">&quot;black&quot;</span>
    <span style="color:#0057ae;">color</span>: <span style="color:#0057ae;">mouse</span>.<span style="color:#0057ae;">pressed</span> ? <span style="color:#bf0303;">&quot;steelblue&quot;</span> : <span style="color:#bf0303;">&quot;lightsteelblue&quot;</span>
    <span style="color:#0057ae;">gradient</span>: <span style="color:#008000;">Gradient</span> {
            <span style="color:#008000;">GradientStop</span> { <span style="color:#0057ae;">position</span>: <span style="color:#0057ae;">mouse</span>.<span style="color:#0057ae;">pressed</span> ? <span style="color:#b08000;">1.0</span> : <span style="color:#b08000;">0.0</span>; <span style="color:#0057ae;">color</span>: <span style="color:#bf0303;">&quot;steelblue&quot;</span> }
            <span style="color:#008000;">GradientStop</span> { <span style="color:#0057ae;">position</span>: <span style="color:#0057ae;">mouse</span>.<span style="color:#0057ae;">pressed</span> ? <span style="color:#b08000;">0.0</span> : <span style="color:#b08000;">1.0</span>; <span style="color:#0057ae;">color</span>: <span style="color:#bf0303;">&quot;lightsteelblue&quot;</span> }
    }
    <span style="color:#008000;">MouseRegion</span> { <span style="color:#0057ae;">id</span>: mouse; <span style="color:#0057ae;">anchors</span>.<span style="color:#0057ae;">fill</span>: parent; <span style="color:#0057ae;">onClicked</span>: <span style="color:#0057ae;">container</span>.<span style="color:#0057ae;">clicked</span>() }
    <span style="color:#008000;">Text</span> { <span style="color:#0057ae;">anchors</span>.<span style="color:#0057ae;">fill</span>: parent; <span style="color:#0057ae;">text</span>: <span style="color:#0057ae;">container</span>.<span style="color:#0057ae;">label</span>; <span style="color:#0057ae;">anchors</span>.<span style="color:#0057ae;">centerIn</span>: parent }
}

<span style="color:#008000;">Rectangle</span> {
    <span style="color:#008000;">Script</span> {
        <span style="font-weight:bold;">function</span> <span style="color:#0057ae;">calculateMyHeight</span>() {
            <span style="font-weight:bold;">return</span> <span style="color:#0057ae;">Math</span>.<span style="color:#0057ae;">max</span>(<span style="color:#0057ae;">otherItem</span>.<span style="color:#0057ae;">height</span>, <span style="color:#0057ae;">thirdItem</span>.<span style="color:#0057ae;">height</span>);
        }
    }

    <span style="color:#0057ae;">anchors</span>.<span style="color:#0057ae;">centerIn</span>: parent
    <span style="color:#0057ae;">width</span>: <span style="color:#0057ae;">Math</span>.<span style="color:#0057ae;">min</span>(<span style="color:#0057ae;">otherItem</span>.<span style="color:#0057ae;">width</span>, <span style="color:#b08000;">10</span>)
    <span style="color:#0057ae;">height</span>: <span style="color:#0057ae;">calculateMyHeight</span>()
    <span style="color:#0057ae;">color</span>: { <span style="font-weight:bold;">if</span> (width &gt; <span style="color:#b08000;">10</span>) <span style="color:#bf0303;">&quot;blue&quot;</span>; <span style="font-weight:bold;">else</span> <span style="color:#bf0303;">&quot;red&quot;</span> }
}

<span style="color:#008000;">Rectangle</span> {
    <span style="font-weight:bold;">default property</span> <span style="color:#0057ae;">color</span> innerColor: <span style="color:#bf0303;">&quot;black&quot;</span>
    <span style="font-weight:bold;">property</span> <span style="color:#0057ae;">color</span> innerColor: <span style="color:#bf0303;">&quot;black&quot;</span>
    <span style="font-weight:bold;">property</span> <span style="color:#0057ae;">alias</span> text: <span style="color:#0057ae;">textElement</span>.<span style="color:#0057ae;">text</span>
    <span style="font-weight:bold;">property</span> <span style="color:#0057ae;">alias</span> aliasXYZ: <span style="color:#0057ae;">testElement</span>.<span style="color:#0057ae;">text</span>
    <span style="color:#0095ff;font-weight:bold;">signal</span> bar
    <span style="color:#0095ff;font-weight:bold;">signal</span> bar(<span style="color:#0057ae;">var</span> blah, <span style="color:#0057ae;">string</span> yxcv)
    <span style="color:#0057ae;">width</span>: <span style="color:#b08000;">240</span>; <span style="color:#0057ae;">height</span>: <span style="color:#b08000;">320</span>;
    <span style="color:#0057ae;">width</span>: <span style="color:#b08000;">100</span>; <span style="color:#0057ae;">height</span>: <span style="color:#b08000;">30</span>; <span style="color:#0057ae;">source</span>: <span style="color:#bf0303;">&quot;images/toolbutton.sci&quot;</span>
    <span style="color:#008000;">ListView</span> {
        <span style="color:#0057ae;">anchors</span>.<span style="color:#0057ae;">fill</span>: parent
        <span style="color:#0057ae;">model</span>: contactModel
        <span style="color:#0057ae;">delegate</span>: <span style="color:#008000;">Component</span> {
            <span style="color:#008000;">Text</span> {
                <span style="color:#0057ae;">text</span>: <span style="color:#0057ae;">modelData</span>.<span style="color:#0057ae;">firstName</span> + <span style="color:#bf0303;">&quot; &quot;</span> + <span style="color:#0057ae;">modelData</span>.<span style="color:#0057ae;">lastName</span>
            }
        }
    }
}

<span style="color:#008000;">Item</span> {
    <span style="font-weight:bold;">function</span> <span style="color:#0057ae;">say</span>(text) {
        <span style="color:#0057ae;">console</span>.<span style="color:#0057ae;">log</span>(<span style="color:#bf0303;">&quot;You said &quot;</span> + text);
    }
}
</pre></body></html>
